nand_util: drop trailing all-0xff pages if requested
authorBen Gardiner <[email protected]>
Tue, 14 Jun 2011 20:35:06 +0000 (16:35 -0400)
committerScott Wood <[email protected]>
Fri, 1 Jul 2011 20:56:51 +0000 (15:56 -0500)
commit169d54d8b33b4d06d6f215e2b312a0b18f7909dc
tree0911e2f0acb0279b3bf8239c8d32546499a9ee18
parentc135456ff59aed0302f99a2e1327939bdced77f5
nand_util: drop trailing all-0xff pages if requested

Add a flag to nand_read_skip_bad() such that if true, any trailing
pages in an eraseblock whose contents are entirely 0xff will be
dropped.

The implementation is via a new drop_ffs() function which is
based on the function of the same name from the ubiformat
utility by Artem Bityutskiy.

This is as-per the reccomendations of the UBI FAQ [1]

[1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo

Signed-off-by: Ben Gardiner <[email protected]>
CC: Artem Bityutskiy <[email protected]>
Acked-by: Detlev Zundel <[email protected]>
CC: Scott Wood <[email protected]>
Signed-off-by: Scott Wood <[email protected]>
drivers/mtd/nand/nand_util.c
include/nand.h